package com.zpark.it.clients;

import com.zpark.it.param.ProductSearchParam;
import com.zpark.it.pojo.Product;
import com.zpark.it.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Title: SearchClient 搜索服务调用客户端
 * @Author Charles
 * @Package com.zpark.it.clients
 * @Date 2023/7/23 21:17
 */
@FeignClient("search-service")
public interface SearchClient {


    @PostMapping("/search/product")
    R search(@RequestBody ProductSearchParam productSearchParam);

    @PostMapping("/search/save")
    R saveOrUpdate(@RequestBody Product product);

    @PostMapping("/search/remove")
    R remove(@RequestBody Integer productId);
}
